/*
 * @Author: tanjunyi@doctorwork.com
 * @Date: 2020-04-02 22:15:19
 * @LastEditors: tanjunyi@doctorwork.com
 * @LastEditTime: 2020-04-08 18:12:32
 * @Description:
 */
var path = require('path');
var myLoader = require('./loader/myloader');
var myPlugin = require('./plugin/myPlugin');
// const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
	entry: './src/index.js',
	devtool: 'source-map',
	output: {
		path: path.resolve(__dirname, './dist'),
		filename: 'bundle.js'
	},
	resolve: {
		extensions: ['.js', '.vue', '.json'],
		alias: {
			'vue$': 'vue/dist/vue.esm.js',
			'@': '/src',
			'src': '/src',
			'api': '/src/api',
			'storage': '/src/module/storage.js',
			'common': '/src/components/common'
		}
	},
	module: {
		rules: [
			{
				test: /\.js$/,
				exclude: /(node_modules|bower_components)/,
				use: [{
					loader: myLoader
				}, {
					loader: 'babel-loader',
					options: {
						presets: ['@babel/preset-env']
					}
				}]
			},
			{
				test: /\.css$/,
				use: [
					{ loader: "style-loader" },
					{ loader: "css-loader" }
				]
			}
		]
	},
	plugins: [
		new myPlugin()
		// new HtmlWebpackPlugin(),
	]

}
